<template>
  <Section width="100%">
    <GapedColumn width="100%" gap="middle">
      <h1 class="page-title">日志详情</h1>
      <GapedRow width="100%" align-items="flex-start">
        <!-- 结构化字段 -->
        <el-card class="stat-card">
          <template #header>
            <div class="card-header">结构化字段</div>
          </template>
          <div v-if="logData">
            <div v-for="(value, key) in logData" :key="key" class="tag-item">
              <strong>{{ key }}:</strong> {{ value }}
            </div>
          </div>
        </el-card>
      </GapedRow>
    </GapedColumn>
  </Section>
</template>

<script setup lang="ts">
import { defineProps } from 'vue'
import { Section, GapedRow, GapedColumn } from '@/core/components'

// 确保在项目入口文件(main.ts)中已引入Font Awesome CSS
// import '@fortawesome/fontawesome-free/css/all.css'

const props = defineProps<{
  logData: Record<string, any>
}>()
</script>

<style scoped>
.stat-card {
  flex: 1;
}

.page-title {
  font-weight: 700;
  color: #2d3748;
  font-size: 1.75rem;
  margin-bottom: 0;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
}

.card-header i {
  margin-right: 0.5rem;
  color: var(--primary-color);
  font-size: 1.2rem; /* 增大图标尺寸 */
}

.log-raw {
  background: var(--light-bg);
  border-radius: 8px;
  padding: 1.25rem;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.tag-item {
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .card-header {
    padding: 0.75rem 1rem;
  }
}
</style>
